﻿namespace Sorting.App.Models
{


    /// <summary>
    /// PLC地址的处理
    /// </summary>
    public static class PLCAddrModel
    {




        #region  任务执行时使用
        /// <summary>
        /// 停止0，开始1
        /// </summary>

        public static readonly string? SelectStartStop = "D100";

        public static readonly string? InputKey = "D102";
        /// <summary>
        /// 选择PLC运行模式类型
        /// </summary>
        //public static readonly string? SelectPlcModelType = "D508";
        public static readonly string? SelectPlcModelType = "D6";


        /// <summary>
        ///选择设备运行档位
        /// </summary>
        //public static readonly string? SelectGear = "D509";
        //public static readonly string? SelectGear = "D508";



        /// <summary>
        /// 读取入口皮带线传感器（扫描位置传感器）
        /// </summary>
        //public static readonly string? InLineStartPoint = "D120";
        public static readonly string? InLineStartPoint = "D104";



        /// <summary>
        /// 是否是最后一袋
        /// </summary>
        //public static readonly string IfEndDrug = "D121";
      //  public static readonly string IfEndDrug = "D253";



        /// <summary>
        /// 是否送出
        /// </summary>
        //public static readonly string DrugSendOut = "D122";
        public static readonly string DrugSendOut = "D54";



        /// <summary>
        /// D100 寄存器    写储位号
        /// </summary>
        //public static readonly string? WriteLoc = "D100";
        public static readonly string? WriteLoc = "D110";


        /// <summary>
        /// PLC是否可以写入储位信息
        /// </summary>
       // public static readonly string? ReadIsSucess = "D101";

        /// <summary>
        /// 回原点
        /// </summary>
        //public static readonly string? BackToOrigin = "D510";
        public static readonly string? BackToOrigin = "D3";



        /// <summary>
        /// 回原点状态
        /// </summary>
        /// </summary>
        //public static readonly string? OriginStates = "D511";
        public static readonly string? OriginStates = "D4";



        /// <summary>
        /// 当前任务执行的主键
        /// </summary>
        public static string UUID = "D106";



        /// <summary>
        /// 获取主键地址
        /// </summary>
        public static string GetUUID = "D108";


        /// <summary>
        /// 已经取出PLC队列中的一个
        /// </summary>
        public static string WriteTakeMove = "D254";

        /// <summary>
        /// 读取PLC实际送出的储位号
        /// </summary>
        public static string ReadRealSendLoc = "D255";

        /// <summary>
        /// PLC存活
        /// </summary>
        public static string PLCLife = "D1";

        /// <summary>
        /// 软件存活
        /// </summary>
        public static string SoftWareLife = "D0";


        /// <summary>
        /// PLC开始自检
        /// </summary>
        public static string SetStartCheck = "D256";

        /// <summary>
        /// 自检状态
        /// </summary>
        public static string CheckState = "D257";




        #endregion



        #region  调试使用地址

        /// <summary>
        /// X轴速度
        /// </summary>
        //public static readonly string SetXSpeed = "D502";



        /// <summary>
        /// Z轴速度
        /// </summary>
       // public static readonly string SetZSpeed = "D506";


        /// <summary>
        /// 输入皮带转动
        /// </summary>
        public static string RunInLine = "D200";

        /// <summary>
        /// 转向皮带
        /// </summary>
        public static string RunReturnLine = "D204";
        /// <summary>
        /// 扫码皮带
        /// </summary>
        public static string RunScan = "D202";

        /// <summary>
        /// 托盘A皮带正反转
        /// 1：正转 2：反转
        /// </summary>
        public static string RunTrayA = "D206";
        /// <summary>
        /// 托盘B皮带正反转
        /// 1：正转 2：反转
        /// </summary>
        public static string RunTrayB = "D208";
        /// <summary>
        /// 挡板A
        /// </summary>

        public static string TA = "D210";
        /// <summary>
        /// 挡板B
        /// </summary>

        public static string TB = "D212";
        /// <summary>
        /// A模组X(横)轴
        /// </summary>

        public static string ModuleAX = "D220";
        /// <summary>
        /// A模组Z(纵)轴
        /// </summary>

        public static string ModuleAZ = "D222";
        /// <summary>
        /// B模组X(横)轴
        /// </summary>

        public static string ModuleBX = "D224";
        /// <summary>
        /// B模组Z(纵)轴
        /// </summary>

        public static string ModuleBZ = "D226";

        //=======================  需要读取的地址===============================

        /// <summary>
        /// X轴正极限（AX轴正极限）
        /// </summary>
        public static string XPositiveLimit = "D10";

        /// <summary>
        /// X轴反极限（AX轴负极限）
        /// </summary>
        public static string XNegativeLimit = "D12";

        /// <summary>
        /// X轴原点
        /// 初始状态下值为1，感应到物体为0
        /// </summary>
        public static string XOrigin = "D11";

        /// <summary>
        /// BX外侧传感器，正极限
        /// </summary>
        public static string BX1 = "D20";
        /// <summary>
        /// BX内侧传感器，负极限
        /// </summary>
        public static string BX0 = "D18";
        /// <summary>
        /// BX原点传感器
        /// </summary>
        public static string BXy = "D19";
        /// <summary>
        /// BX伺服使能
        /// </summary>
        public static string BXs = "D21";
        /// <summary>
        /// BZ上方传感器
        /// </summary>
        public static string BZ1 = "D24";
        /// <summary>
        /// BZ下方传感器
        /// </summary>
        public static string BZ0 = "D22";
        /// <summary>
        /// BZ原点传感器
        /// </summary>
        public static string BZy = "D23";
        /// <summary>
        /// BZ伺服使能
        /// </summary>
        public static string BZs = "D25";
        /// <summary>
        /// A托盘入口传感器
        /// </summary>
        public static string ATI = "D30";
        /// <summary>
        /// A托盘中间传感器
        /// </summary>
        public static string ATM = "D31";
        /// <summary>
        /// A托盘出口传感器
        /// </summary>
        public static string ATO = "D32";
        /// <summary>
        /// B托盘入口传感器
        /// </summary>
        public static string BTI = "D33";
        /// <summary>
        /// B托盘中间传感器
        /// </summary>
        public static string BTM = "D34";
        /// <summary>
        /// B托盘出口传感器
        /// </summary>
        public static string BTO = "D35";
        /// <summary>
        /// 扫码入口传感器
        /// </summary>
        public static string ScanImp = "D40";
        /// <summary>
        /// 扫码中间传感器
        /// </summary>
        public static string ScanMiddle = "D41";
        /// <summary>
        /// 扫码出口传感器
        /// </summary>
        public static string ScanOut = "D42";
        /// <summary>
        /// 转向传感器
        /// </summary>
        public static string Turn = "D50";
        /// <summary>
        /// 防撞传感器
        /// </summary>
        public static string AC = "D60";
        /// <summary>
        /// 挡板A
        /// </summary>
        public static string DBA = "D210";
        /// <summary>
        /// 挡板B
        /// </summary>
        public static string DBB = "D212";
        /// <summary>
        /// AX轴当前位置脉冲值
        /// </summary>
        public static string NowAX = "D80";
        /// <summary>
        /// AZ轴当前位置脉冲值
        /// </summary>
        public static string NowAZ = "D82";
        /// <summary>
        /// BX轴当前位置脉冲值
        /// </summary>
        public static string NowBX = "D84";
        /// <summary>
        /// BZ轴当前位置脉冲值
        /// </summary>
        public static string NowBZ = "D86";
        /// <summary>
        /// AX轴正极限脉冲值
        /// </summary>
        public static string BoundsAX1 = "D6100";
        /// <summary>
        /// BX轴正极限脉冲值
        /// </summary>
        public static string BoundsBX1 = "D6108";
        /// <summary>
        /// AZ轴正极限脉冲值
        /// </summary>
        public static string BoundsAZ1 = "D6104";
        /// <summary>
        /// BZ轴正极限脉冲值
        /// </summary>
        public static string BoundsBZ1 = "D6112";
        /// <summary>
        /// AX轴负极限脉冲值
        /// </summary>
        public static string BoundsAX0 = "D6102";
        /// <summary>
        /// BX轴负极限脉冲值
        /// </summary>
        public static string BoundsBX0 = "D6110";
        /// <summary>
        /// AZ轴负极限脉冲值
        /// </summary>
        public static string BoundsAZ0 = "D6106";
        /// <summary>
        /// BZ轴负极限脉冲值
        /// </summary>
        public static string BoundsBZ0 = "D6114";
        /// <summary>
        /// A/B:X轴1列
        /// </summary>
        public static string C1 = "D4000";
        /// <summary>
        /// A/B:X轴2列
        /// </summary>
        public static string C2 = "D4002";
        /// <summary>
        /// A/B:X轴3列
        /// </summary>
        public static string C3 = "D4004";
        /// <summary>
        /// A/B:X轴4列
        /// </summary>
        public static string C4 = "D4006";
        /// <summary>
        /// A/B:X轴5列
        /// </summary>
        public static string C5 = "D4008";
        /// <summary>
        /// A/B:X轴6列
        /// </summary>
        public static string C6 = "D4010";
        /// <summary>
        /// A/B:X轴7列
        /// </summary>
        public static string C7 = "D4012";
        /// <summary>
        /// A/B:X轴8列
        /// </summary>
        public static string C8 = "D4014";
        /// <summary>
        /// A/B:X轴9列
        /// </summary>
        public static string C9 = "D4016";
        /// <summary>
        /// AZ轴1层
        /// </summary>
        public static string AR1 = "D4100";
        /// <summary>
        /// AZ轴2层
        /// </summary>
        public static string AR2 = "D4102";
        /// <summary>
        /// AZ轴3层
        /// </summary>
        public static string AR3 = "D4104";
        /// <summary>
        /// BZ轴1层
        /// </summary>
        public static string BR1 = "D4106";
        /// <summary>
        /// BZ轴2层
        /// </summary>
        public static string BR2 = "D4108";
        /// <summary>
        /// BZ轴3层
        /// </summary>
        public static string BR3 = "D4110";
        /// <summary>
        /// 托盘AX轴安全位置
        /// </summary>
        public static string SafeAX = "D5010";
        /// <summary>
        /// 托盘AZ轴安全位置
        /// </summary>
        public static string SafeAZ = "D5012";
        /// <summary>
        /// 托盘BX轴安全位置
        /// </summary>
        public static string SafeBX = "D5014";
        /// <summary>
        /// 托盘BZ轴安全位置
        /// </summary>
        public static string SafeBZ = "D5016";
        /// <summary>
        /// 托盘AX轴药品输入位置
        /// </summary>
        public static string DrugAx = "D5000";
        /// <summary>
        /// 托盘AZ轴药品输入位置
        /// </summary>
        public static string DrugAz = "D5002";
        /// <summary>
        /// 托盘BX轴药品输入位置
        /// </summary>
        public static string DrugBx = "D5004";
        /// <summary>
        /// 托盘BZ轴药品输入位置
        /// </summary>
        public static string DrugBz = "D5006";
        /// <summary>
        /// AX轴速度
        /// </summary>
        public static string SpeedAX = "D6000";
        /// <summary>
        /// AZ轴速度
        /// </summary>
        public static string SpeedAZ = "D6002";
        /// <summary>
        /// BX轴速度
        /// </summary>
        public static string SpeedBX = "D6004";
        /// <summary>
        /// BZ轴速度
        /// </summary>
        public static string SpeedBZ = "D6006";
        /// <summary>
        /// 进入一袋药信号滤波时间
        /// </summary>
        public static string FilterTime = "D3000";
        /// <summary>
        /// 输入出药时间
        /// </summary>
        public static string InputTime = "D3010";
        /// <summary>
        /// 扫码入药时间
        /// </summary>
        public static string ScanInTime = "D3020";
        /// <summary>
        /// 扫码出药时间
        /// </summary>
        public static string ScanOutTime = "D3022";
        /// <summary>
        /// 转向入药时间
        /// </summary>
        public static string TurnInTime = "D3030";
        /// <summary>
        /// 转向出药时间
        /// </summary>
        public static string TurnOutTime = "D3032";
        /// <summary>
        /// 托盘入药时间
        /// </summary>
        public static string PalletInTime = "D3040";
        /// <summary>
        /// 托盘出药容错时间
        /// </summary>
        public static string ErrorTime = "D3042";
        /// <summary>
        /// 托盘出药延迟时间
        /// </summary>
        public static string DelayTime = "D3044";
        /// <summary>
        /// 托盘出药超时时间
        /// </summary>
        public static string OutTime = "D3046";
        /// <summary>
        /// 模组数量1/2
        /// </summary>
        public static string ModuleNum = "D3100";
        /// <summary>
        /// 储位数量38/49
        /// </summary>
        public static string StorageNum = "D3102";
        /// <summary>
        /// Z轴正极限
        /// </summary>
        public static string ZPositiveLimit = "D16";

        /// <summary>
        /// Z轴反极限
        /// </summary>
        public static string ZNegativeLimit = "D14";

        /// <summary>
        /// Z轴原点
        /// 初始状态下值为1，感应到物体为0
        /// </summary>
        public static string ZOrigin = "D15";

        /// <summary>
        /// 轨道安全   
        /// 两轴距离过近传感器  
        /// 距离过近时值为0，正常运行时值为1
        /// </summary>
        public static string RailSafety = "D7";

        /// <summary>
        /// 输入皮带开始位置 调试使用监控
        /// </summary>
        public static string InLineBeginPoint = "D10";

        // <summary>
        /// 输入皮带终止位置 调试使用监控
        /// </summary>
        public static string InLineFinishPoint = "D11";

        /// <summary>
        /// 转向皮带传感器
        /// </summary>
        public static string TrunLinePoint = "D12";

        /// <summary>
        /// 托盘开始点
        /// </summary>
        public static string TrayBeginPoint = "D13";

        /// <summary>
        /// 托盘中间点
        /// </summary>
        public static string TrayMiddlePoint = "D14";


        /// <summary>
        /// 托盘结束点
        /// </summary>
        public static string TrayFinishPoint = "D15";

        /// <summary>
        /// X轴电机使能
        /// </summary>
        public static string XMotorMake = "D13";

        /// <summary>
        /// Z轴电机使能
        /// </summary>
        public static string ZMotorMake = "D17";


        /// <summary>
        /// X轴回原点状态
        /// </summary>
        public static string XBackOrgin = "D201";

        /// <summary>
        /// Z轴回原点状态
        /// </summary>
        public static string ZBackOrgin = "D211";




        #endregion





    }

}
